import time
import sys

def print_slow(text, delay=0.03):
    """逐字慢速打印，营造悠然氛围"""
    for char in text:
        sys.stdout.write(char)
        sys.stdout.flush()
        time.sleep(delay)
    print()

def print_poem():
    """打印《晨钓》并添加适当排版"""
    # 诗歌信息
    title = "晨钓"
    author = "作者: 张军"
    verses = [
        "披星早向五更天，踏露垂纶野水边。",
        "辨迹寻窝投饵准，凝神测底望漂悬。",
        "银鳞觅食草丛动，金鲤吞钩鱼护阗。",
        "独坐矶头尘世远，清波照影共悠然。"
    ]
    
    # 打印标题
    print("=" * 30)
    print_slow(f"\n{title:^30}", 0.1)  # 居中对齐
    print_slow(f"{author:^30}\n", 0.1)  # 居中对齐
    
    # 打印诗句，每句之间有停顿
    for i, verse in enumerate(verses):
        print_slow(f"   {verse}", 0.05)
        # 中间两句后停顿久一点，营造钓鱼的宁静感
        if i == 1 or i == 2:
            time.sleep(1)
    
    print("\n" + "=" * 30)
    
    for exp in explanations:
        print_slow(exp, 0.02)
        time.sleep(0.2)

if __name__ == "__main__":
    print_poem()

